const a = 'aa/bb/cc/dd';
const b = './../../ee';
const c = '/ee';

function resolve(a, b) {
    let base = a.split('/'), r = [];
    b.split('/').forEach(c => {
        if (c === '..') {
            base.pop();
        } else if (c !== '.') {
            r.push(c);
        }
    });
    return [...base, ...r].join('/');
}

console.log(a.split('/'));
console.log(b.split('/'));
console.log(c.split('/'));
// console.log(resolve(a, b));